<extend name="Common@Layout:layui-admin" />
<block name="title">
    <title>角色管理</title>
</block>
<block name="style">
    <style>
        body {
            padding: 10px;
        }
    </style>
</block>

<block name="main">
    <div class="my-btn-box">
        <span class="fl">
	        <a class="layui-btn btn-add btn-default" onclick="open_iframe_dialog('{:U('role_edit')}','添加角色',['900px','700px'],0)" id="btn-add-article">添加JSON</a>
	    </span>
    </div>

    <div class="layui-form datashow" data-url="{:U('get_role_data')}" data-condition="" data-p="" data-row="10">
        <table class="layui-table">
            <colgroup>
                <col width="50">
                <col width="50">
                <col width="170">
                <col width="180">
                <col>
                <col width="200">
                <col width="136">
            </colgroup>
            <thead>
                <tr>
                    <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
                    <th>ID</th>
                    <th>角色名称</th>
                    <th>角色KEY</th>
                    <th>配置</th>
                    <th>更新时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="data"></tbody>
        </table>
        <div class="page"></div>
        <script class="data-tpl" type="text/html">
            {{# layui.each(d, function(index, item){ }}
            <tr>
                <td><input type="checkbox" name="ids[]" value="{{item.id}}" lay-skin="primary">
                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
                </td>
                <td>{{item.id}}</td>
                <td>{{item.title}}</td>
                <td>{{item.key}}</td>
                <td>{{item.json}}</td>
                <td>{{item.update_time}}</td>
                <td>
                    <button onclick="open_iframe_dialog('/admin/users/role_edit/id/{{item.id}}','编辑角色',['900px','700px'],1)" class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                    <button class="layui-btn layui-btn-small layui-btn-danger mini_del" data-url="/admin/json/role_del/ids/{{item.id}}">删除</button>
                </td>
            </tr>
            {{# }); }} {{# if(d.length === 0){ }} --- No Data --- {{# } }}
        </script>
    </div>
</block>

<block name="script">
    <script>
    </script>
</block>